home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10559 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.0 KB  |  72 lines

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c++,comp.lang.c
  4. Subject: Re: Opinions on Visual C/C++
  5. Date: 06 Mar 1996 15:31:07 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <TANMOY.96Mar6083107@qcd.lanl.gov>
  8. References: <4hdkm7$2jk@huron.eel.ufl.edu> <Dnq94s.Cx3@emr1.emr.ca>
  9.     <4hhfho$igo@news.interpath.net> <4hj26l$6oj@flood.xnet.com>
  10. NNTP-Posting-Host: qcd.lanl.gov
  11. Mime-Version: 1.0
  12. Content-Type: text
  13. In-reply-to: kd9fb@xnet.com's message of Wed, 06 Mar 1996 03:57:08 GMT
  14.  
  15. In article <4hj26l$6oj@flood.xnet.com>
  16. kd9fb@xnet.com (Peter Mikalajunas) writes:
  17. <snip>
  18. PM: As long as the switch is there at compile time.  I have yet
  19. PM: to work with a compiler that defaulted to ANSI.  Every one
  20. PM: requires a conscious effort on the part of the programmer.
  21. PM: 
  22. PM: This make sense.  The vendor is selling a product to work
  23. PM: on a particular platform.  Throwing in ANSI compatibility is just
  24. PM: one more item to put on the glossy.   If you are asking 
  25. PM: $30,000 for a compiler, your customer has every right 
  26. PM: to expect it to handle platform specific issues.  Because
  27. PM: it can do low level RMS databases on  a VMS system 
  28. PM: doesn't make it a different language.  It merely gives 
  29. PM: the tool added flexibility.
  30.  
  31. I do not completely agree with this: The C standard requires the
  32. compiler to complain about invalid usage in certain situations. Any
  33. compiler `feature' which does _not_  complain in these situations is a
  34. misfeature: whether people on any particular platform find it handy or
  35. not. Thus, for example, popular compilers manage to compile the
  36. following without warning:
  37.  
  38. int main(void) {
  39.   int a=2; int b[a] = {&a};
  40.   return 0;
  41. }
  42.  
  43. This I believe is wrong! There is absolutely no reason to accept such
  44. constructs silently in the default mode. (I would prefer that the user
  45. had to say 
  46.  
  47. cc -but_I_must_have_extensions_as_I_clearly_do_not_need_portability
  48.  
  49. to compile such stuff. (Note that I would use that flag quite often,
  50. but I still do not support absence of warning as the default.)
  51.  
  52. Extensions must apply silently only to those constructs that do not
  53. need a diagnostic according to the standard. There is also very little
  54. reason to extend the syntax of C.
  55.  
  56. It is also bad practice to define meanings for most `undefined'
  57. behaviours in C. I think any compiler that defines i=i++; is doing its
  58. users a disservice. Even within these limits, C bindings to OS
  59. features are trivial. Customers have the right to expect that, they
  60. have a bigger right to expect that the compiler follows the only
  61. document that claims to define C.
  62.  
  63. Cheers
  64. Tanmoy
  65. --
  66. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  67. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  68. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  69. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  70. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  71. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  72.